package mails;


public class Segment {
	public final static int SPACEX = 1;
	public final static int SPACEY = 2;
	public final static int SEGWEIGHT = 2;
	public int center;
	public int offsetX;
	
	private int id;
	private int segX;
	private int segY;
	
	private int _x;

	private int _y;
	
	private String name;
	private String body;
	
	private boolean segColor, active, dropping, removing = false;


	private int segWeight;
	private String segDate;

	int speed=100;
	int top=-1000;
	private int size;

	
	public Segment(int id, int x, int y, int size,  boolean _color, int _segWeight, String _segDate, String _name, String _body) {
		this.id = id;
		this.segX = x;
		this.segY = y;
		this._x=x;
		this._y=top;
		this.size = size;
		this.segColor =  _color;
		this.segWeight = _segWeight;
		this.active=false;
		this.segDate = _segDate;
		this.name=_name;
		this.body = _body;
	}
	
	
	public void drop(){

if(speed>10){this.speed--;}
	if(_y<=segY && dropping && !removing){
			_y+=Math.round((Math.abs(_y)-Math.abs(segY)))/speed;
		}
	}
	
	public void remove(){

		if(this._y>=top && this.removing){
				this._y+=Math.round((Math.abs(this._y)-Math.abs(top)))/10;
			}
	}
	
	


	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}


	public void setSegX(int segX) {
		this.segX = segX;
	}


	public int getSegX() {
		return segX;
	}


	public void setSegY(int segY) {
		this.segY = segY;
	}


	public int getSegY() {
		return segY;
	}


	public void setSegColor(boolean segColor) {
		this.segColor = segColor;
	}


	public boolean getSegColor() {
		return segColor;
	}
	
	public int getSegWeight() {
		return segWeight;
	}

	public void setSegWeight(int segWeight) {
		this.segWeight = segWeight;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}
	
	public int get_x() {
		return _x;
	}

	public void set_x(int _x) {
		this._x = _x;
	}

	public int get_y() {
		return _y;
	}

	public void set_y(int _y) {
		this._y = _y;
	}





	public String getSegDate() {
		return segDate;
	}





	public void setSegDate(String segDate) {
		this.segDate = segDate;
	}


	public boolean isDropping() {
		return dropping;
	}


	public void setDropping(boolean dropping) {
		this.dropping = dropping;
	}


	public boolean isRemoving() {
		return removing;
	}


	public void setRemoving(boolean removing) {
		this.removing = removing;
	}


	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public void setBody(String body) {
		this.body = body;
	}


	public String getBody() {
		return body;
	}
}
